package org.kmfdm.horrorscope.core.dao.hibernate;

import java.util.List;

import org.hibernate.criterion.Restrictions;
import org.kmfdm.horrorscope.core.dao.UserDAO;
import org.kmfdm.horrorscope.metamodel.Customer;
import org.kmfdm.horrorscope.metamodel.User;
import org.springframework.transaction.annotation.Transactional;

public class UserDAOHibernate extends GenericDAOHibernate<User, Long> implements UserDAO {
	
	public Class<User> getPersistentClass(){
		return User.class;
	}
	
	
	@Transactional
	public List<User> findUserByUsername(String username){
		
		return search(Restrictions.eq("username", username));
		
	}
	@Transactional
	public List<User> checkUserPass(String username, String pass){
		
		return search(Restrictions.eq("username", username),Restrictions.eq("password", pass));
	}
}
